package com.chis.jxc;

import com.chis.jmdatatimer.comm.TxMgmtModule;
import com.chis.jxc.bean.IsoBean;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

/**
 * 
 * @Description 查询hbase隔离库存表中，已经销毁的码库存，手工更新隔离库存数量
 * @Company zwx
 * @author wlj
 * @version 2019年10月11日
 */
public class JxcIso {

    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"spring.xml","consumer_sparkdeal.xml"});
        context.start();
        TxMgmtModule txMgmtModule = (TxMgmtModule) context.getBean("TxMgmtModule");
        List<IsoBean> isoStm = txMgmtModule.findIsoStm();
        for(IsoBean bean : isoStm){
            if(bean.getStmcnt() != 0){
                Integer state = txMgmtModule.findmysqliso(bean.getUnitCode(), bean.getHeapCode());
                if(state != null && state == 2){
                    System.out.println(bean.getUnitCode()+"xa"+bean.getMetarial()+"xb"+bean.getBatnmb()+"xc"+bean.getHeapCode());
                }
            }
        }

    }

}
